<section id="header">
	<div class="container">
		<div class="rows">
			<div class="col-md-9 col-sm-12">
				<div class="box-title-page">
					<h4>Recipes</h4>
				</div><br />
				<div class="row">
					<?php if(isset($items) && !empty($items)): 
						$i = 1;
						foreach ($items as $item): 
						if($i == 4 || $i == 7 || $i == 10 || $i == 13) $clear = 'clear:both';
						else $clear = '';	
					?>
					<div class="col-md-3 col-sm-12" style='margin-bottom:10px !important;<?php echo $clear; ?>'>
						<div class="box-recipes">
							<div class='image-recipes'>
								<?php if(!empty($item->r_filename)): ?>
								<img class="img-responsive" src="<?php echo site_url('recipes/appimage/recipes/'.$item->r_filename); ?>" alt="<?php echo $item->r_fileorig; ?>">
								<?php else: ?>
								<img class="img-responsive" src="<?php echo site_url('recipes/themeimage/logo.png'); ?>" alt="haan">
								<?php endif; ?>
							</div>
							<div class="caption">
								<div class="rating-in-list"><?php $rating = $this->rm->show_rating($item->r_id); echo $rating; ?></div>
								<!-- <h4><?php echo date("d F, Y", strtotime($item->r_created_date)); ?></h4> -->
								<a href="<?php echo site_url('recipes/detail/'.slugify($item->r_name).'/'.$item->r_id); ?>">
									<h2><?php echo $item->r_name; ?></h2>
								</a>
								
							</div>
						</div>
					</div>
					<?php 
						$i++;
					endforeach; endif; ?>
				</div>
				<div class="text-center">
					<ul class="pagination">
						<?php echo $pagination; ?>
					</ul>
				</div>
			</div>
			<div class="col-md-3 col-sm-12">
				<div class="list-group">
					<a href="#" class="list-group-item active">
						<i class="fa fa-file-o"></i> Categories Recipes
					</a>
					<?php if(isset($categories)): foreach ($categories as $cat): ?>
						<a href="<?php echo site_url('recipes/categories/'.$cat->cr_id); ?>" class="list-group-item">
							<i class="fa fa-file"></i> <?php echo $cat->cr_name; ?>
						</a>	
					<?php endforeach; endif; ?>
				</div>
				<div class="bs-example">
				    <div class="list-group">
				        <a href="#" class="list-group-item active">
				            <span class="glyphicon glyphicon-file"></span> Recent Article
				        </a>
				        <?php if(isset($recent_articles)): foreach ($recent_articles as $articles): ?>
							<a href="<?php echo site_url('articles/detail/'.$articles->a_title.'/'.$articles->a_id); ?>" class="list-group-item">
								<i class="fa fa-gift"></i> <?php echo $articles->a_title; ?>
							</a>	
						<?php endforeach; endif; ?>
				    </div>
				</div>
				<div class="bs-example">
				    <div class="list-group">
				        <a href="#" class="list-group-item active">
				            <span class="glyphicon glyphicon-file"></span> Recent Products
				        </a>
				        <?php if(isset($recent_products)): foreach ($recent_products as $products): ?>
							<a href="<?php echo site_url('products/detail/'.slugify($products->p_name).'/'.$products->p_id); ?>" class="list-group-item">
								<i class="fa fa-gift"></i> <?php echo $products->p_name; ?>
							</a>	
						<?php endforeach; endif; ?>
				    </div>
				</div>
				<div style='margin-top:10px;margin-bottom:10px;'>
					<?php
						if(isset($widget_home)): foreach ($widget_home as $widget): 
							if ($widget->widget_place == 1)	echo $widget->widget_source;
						endforeach; endif; 
					?>
				</div>
			</div>
		</div>
	</div>
</section>